/*

 @name    : 锅巴汉化 - Web汉化插件
 @author  : 麦子、JAR、小蓝、好阳光的小锅巴
 @version : V0.6.1 - 2019-07-09
 @website : http://www.g8hh.com

*/

//1.汉化杂项
var cnItems = {
    _OTHER_: [],

    //未分类：
    'Autobuyers': '自动购买者',
    'Autoprestigers': '自动声望者',
    'Boosters': '助推器',
    'Booster Upgrades': '助推器升级',
    'Aleph Power': '阿列夫电源',
    'Aleph Upgrades': '阿列夫升级',
    'Save your game': '保存游戏',
    'Singularity': '奇点',
    'Singularity Level': '奇点等级',
    'Soon': '很快',
    'Options': '选项',
    'Upgrades': '升级',
    'video': '视频',
    'Downgrade to lvl': '降级至等级',
    'Exit Challenge': '退出挑战',
    'Export your game file': '导出存档',
    'Extend Incrementy': '增量递增',
    'Free': '免费',
    'ON': '启用',
    'OFF': '关闭',
    'Need': '需要',
    'Objectives': '目标',
    'per second': '每秒',
    'REALLY': '真的',
    'Redacted': '修订',
    'Assign': '转生',
    'Assign all': '全部转生',
    'Auto': '自动',
    'Auto Incrementer': '自动递增',
    'Incrementers': '递增',
    'Unlock Autobuyer & Challenges': '解锁自动购买者和挑战',
    'Unlock Autobuyer & Challenge': '解锁自动购买者和挑战',
    'Unlock Challenges': '解锁挑战',
    'Unlock Dark Upgrades in the Markup Tab': '在“标记”选项卡中解锁“黑暗升级”',
    'Unlock Distribute All and upgrades for Tier 3 automation': '解锁全部分配并升级第3层自动化',
    'Unlock Incrementy': '解锁增量',
    'Unlock Markup autoclicker': '解锁标记自动点击者',
    'Unlock the next layer': '解锁下一层',
    'Unlock the Singularity': '解锁奇点',
    'pgrade with': '升级与',
    ', Currently': ', 当前',
    ', otherwise double it': '，否则加倍',
    '| Game autosaves every ten seconds': '| 游戏每十秒钟自动保存一次',
    'and ??': '和 ??',
    'Challenge': '挑战',
    'Challenges': '挑战',
    'Changelog': '更新日志',
    'Classified': '分类',
    'Coming Soon!': '即将推出！',
    'Reach ω': '达到 ω',
    'Cost': '成本',
    'Reduce ℵ': '减少 ℵ',
    'RESET YOUR GAME': '重置游戏',
    'Currently': '当前',
    'Dark Manifolds': '黑暗歧管',
    'effect by': '效果',
    'Extra Factors': '额外因子',
    'Increase Ordinal by': '提高序数 ',
    ', but they reset on Factor Boosts and similar': '，但是它们在因子增强和类似的情况下重置',
    'Tick Incrementer': 'Tick增量器',
    'HACKER!!!': '黑客！！！',
    'How to play': '玩法',
    '60% smaller interval': '间隔缩短60％',
    'You have': '你有',
    '1 RP': '1 RP',
    '1 Booster': '1 助推器',
    '1 Boost': '1 提升',
    '∞ Boosts': '∞ 提升',
    'Sluggish Milestones': '缓慢的里程碑',
    'Reset incrementy for a manifold.': '重置增量式歧管。',
    'Start. Singularity doesn\'t consume Dark Manifolds': '开始。 奇点不消耗黑暗阀组',
    'The World is upon for a crude awakening': '这个世界即将觉醒',
    'Third row of Incrementy applies to Decrementy': '第三行递增适用于递减',
    'Unlock Autobuyers & Challenge': '解锁自动购买者 & 挑战',
    'Unlock autoclicker for maxing all': '解锁自动点击器，以达到最大',
    'Unlock Baseless Milestones': '解锁无用的里程碑',
    'Unlock Extra Factors': '解锁额外因子',
    'upgrade becomes "Double Decrementy Growth," and other Decrementy Upgrades may apply.': '升级变为“双倍递减增长”，并且可能会应用其他递减升级。',
    'You also start with a free Maximize Autoclicker as a gift :': '您还可以从免费赠送的“最大化自动点击器”作为礼物开始：',
    'You found an easter egg! Good job!': '您发现了一个复活节彩蛋！ 做得好！',
    'You gain them when you Collapse': '当你坍缩时，你会获得它们',
    'You gain them when you collapse successfully': '当您成功坍缩时，您会获得它们',
    'YOU HAVE COLLAPSED!': '你已经坍缩！',
    'Reduce manifold requirement scaling': '减少歧管需求比例',
    'Reduce the potency of decrementy by': '减少递减的效力',
    'Refund all Singularity Functions': '退还所有奇点函数',
    'ON': '开启',
    'OFF': '关闭',
    'half of max ℵ': '一半 ℵ',
    'Halve decrementy growth below ω': '将ω以下的衰减增长减半',
    'Halve decrementy growth below ω^(ω3), otherwise double it': '在ω^(ω3)以下将递减增长减半，否则将其翻倍',
    'Ignore in challenge 8: ON': '在挑战8中忽略：开启',
    'Import your game file': '导入你的游戏存档文件',
    'In odd numbered challenges, Dynamic factor is squared': '在奇数挑战中，动态因子平方',
    'Increase Dynamic cap': '增加动态上限',
    'Increase Dynamic increase speed': '提高动态增加速度',
    'Incrementy': '增量式',
    'incrementy multiplier': '增量式乘数',
    'It has more content below ψ(Ω) and you can reach': '它在ψ（Ω）以下具有更多的含量，您可以达到',
    'large numbers (smaller than vanilla though': '大量的 (虽然比香草小',
    'Manifold': '歧管',
    'Manifolds affect Decrementy gain': '歧管影响递减增益',
    'Manifolds are 26% more effective': '歧管效率提高26％',
    'Manifolds are buffed. (x^': '歧管被抛光。(x^',
    'Manifolds boost Tier': '歧管提升层',
    'manifolds, translating to a': '歧管，翻译成',
    'Markup': '标记',
    'LOCKED': '未解锁',
    'Maximize ordinal, but number does not increase': '最大化序数，但数量不增加',
    'Maximize the Singularity': '最大化奇点',
    'Maximum Ordinal Length': '最大序数长度',
    'Millisecond Interval': '毫秒间隔',
    'multiplier by': '乘以',
    'multiplier to OP gain': '序数点增益乘数',
    'Multiply multiplier by': '乘以乘数',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    '': '',
    'Oh, and also, if you like this game, or you dislike the timewalls, why don\'t you play': '哦，而且，如果您喜欢这款游戏，或者您不喜欢时光倒流，为什么不玩',
    'Note: In challenge 8, if you have less than 1.00e10 decrementy, all ticks simulates 50 milliseconds, regardless of the millisecond interval.': '注意：在挑战8中，如果递减值小于1.00e10，则所有刻度线都将模拟50毫秒，而不管毫秒间隔如何。',
    'If you want a greater understanding of how the ordinal works, you might want to watch this': '如果你想更好地理解序数是如何工作的，你可能会想看看这个',
    'You keep all Incrementy Upgrades, Dark Upgrades, Manifolds, and Dark Manifolds on collapse, unlock an Autobuyer for Booster Upgrades, you can autocomplete Challenges, unlock an Autoprestiger for Collapse, you get a free Maximize Autobuyer and you always have a Max All Autobuyer, you can complete Challenge 8 multiple times, reduce the Markup requirement to 10, Auto-Markup activates if you\'re not making autoclicks from Tier 1, and extend the Booster upgrades': '您可以将所有递增升级，黑暗升级，歧管和黑暗歧管保持在折叠状态，解锁自动购买器以进行升压升级，可以自动完成挑战，解锁自动折叠器以进行折叠，获得免费的最大化自动购买器，并且始终拥有最大所有自动购买器， 您可以多次完成挑战8，将标记要求减少到10，如果您不是从方法1进行自动点击，则会激活自动标记，并扩展助推器升级',
    'You may have to rotate your phone on mobile to see all of the upgrades. The right column of upgrades doesn\'t consume your boosters.': '您可能需要旋转手机才能看到所有升级。 升级的右栏不会消耗您的助推器。',
    'You may have to rotate your phone on mobile to see all of the upgrades. Why does this text even exist?': '您可能需要旋转手机才能看到所有升级。 为什么这个文本还存在？',
    'You need a larger singularity before you even think about unlocking this mechanic!': '在考虑解锁此机制之前，您需要更大的奇点！',
    'You have played for 3 days and 5 hours [WIP]': '您已经玩了3天5小时[WIP]',
    'You have Marked up 100 times [WIP]': '您已标记100次[WIP]',
    'You have done 1 Factor Shift [WIP]': '您已完成1因子转换[WIP]',
    'Your 0 challenge completions have multiplied Tier 1 and 2 by x': '您的0个挑战完成次数将第1层和第2层乘以 x',
    'Your 0 challenge completions have multiplied Tier 1 and 2 Automation by': '您的0个挑战完成次数将第1层和第2层自动化乘以',
    'Your Factor Boost Autoprestiger is Factor Boosting 1 time(s) per second, but only at the BHO or higher, and if you can\'t get a sluggish milestone': '您的因子提升自动声望器，每秒执行因子提升1次,但仅适用于BHO或更高级别，并且如果您无法达到一个缓慢的里程碑',
    'Your Factor Boost Autoprestiger is Factor Boosting 1 time per second': '您的因子提升自动声望器，每秒执行因子提升1次',
    'Your Factor Shift Autoprestiger is Factor Shifting 1 time per second': '您的因子转换自动声望器，每秒执行因子转换1次',
    'Your Factor Shift Autoprestiger is Factor Shifting 1 time(s) per second': '您的因子转换自动声望器，每秒执行因子转换1次',
    'Your Max All Autobuyer is clicking the Max All button 1 times per second': '您的“最大全部”自动购买者每秒单击“最大全部”按钮1次',
    'Your Markup Autobuyer is clicking the Markup button 0 times per second, but only if you\'re past ω': '标记自动购买器每秒单击“标记”按钮0次，但前提是您过去ω',
    'Your Markup Autobuyer is clicking the Markup button 1 times per second': '您的标记自动购买器每秒单击“标记”按钮1次',
    'Your last Markup was 1 second ago [WIP]': '您上一次标记是1秒前 [WIP]',
    'Your last Factor Shift was 1 second ago [WIP]': '您上一次的因子转换是1秒前 [WIP]',
    'Your highest Ordinal was w [WIP]': '您最高的序数是 w [WIP]',
    'You\'re currently not in a challenge': '您目前没有在挑战中',
    'This work is licensed under the': '这项工作是根据',
    'Most Cardinals collapsed at once': '大多数基数同时收缩',
    'Your Quadrupler is': '你的四倍器',
    'Your Dynamic Multiplier is': '您的动态乘数为',
    'Your Decrementy is multiplying by': '你的递减乘以',
    'Your Dynamic Factor is': '您的动态因子',

    //原样
    '': '',
    '': '',

}


//需处理的前缀
var cnPrefix = {
    "(-": "(-",
    "(+": "(+",
    "(": "(",
    "-": "-",
    "+": "+",
    " ": " ",
    ": ": "： ",
    "\n": "",
    "                   ": "",
    "                  ": "",
    "                 ": "",
    "                ": "",
    "               ": "",
    "              ": "",
    "             ": "",
    "            ": "",
    "           ": "",
    "          ": "",
    "         ": "",
    "        ": "",
    "       ": "",
    "      ": "",
    "     ": "",
    "    ": "",
    "   ": "",
    "  ": "",
    " ": "",
    "Buy ": "购买 ",
    "Color: ": "颜色: ",
    "Colors: ": "颜色: ",
    "Factor Shift Autoprestiger: ": "因子转移自动提示：",
    "Factor Boost if possible on Refund: ": "如果可能的话，提高因子退款：",
    "Music: ": "音乐: ",
    "Offline Progress: ": "离线进度: ",
    "Autobuy Booster Upgrades: ": "自动购买助推器升级: ",
    "Autocomplete Challenges: ": "自动完成挑战：",
    "Challenge Confirmation: ": "挑战确认：",
    "Complete Challenge ": "完成挑战 ",
    "Cost: ": "成本: ",
    "cost: ": "成本: ",
    "Max Mode: ": "最大模式: ",
    "Current interval: ": "当前时间间隔: ",
    "Current Ordinal Notation: ": "目前序数符号:",
    "Current Theme: ": "当前的主题:",
    "Hotkeys: ": "快捷键: ",
    "T H I C C Buttons: ": "T H I C C 按钮: ",
    "Goal: ": "目标: ",
    "Refund Confirmation: ": "退款确认：",
    "Markup Autobuyer: ": "标记自动购买者：",
    "Max (M": "最大 (M",
    "Max All Autobuyer: ": "最大所有自动购买者：",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
}

//需处理的后缀
var cnPostfix = {
    ":": "：",
    "：": "：",
    ": ": "： ",
    "： ": "： ",
    " ": "",
    "/s)": "/s)",
    "/s": "/s",
    ")": ")",
    "%": "%",
    "                   ": "",
    "                  ": "",
    "                 ": "",
    "                ": "",
    "               ": "",
    "              ": "",
    "             ": "",
    "            ": "",
    "           ": "",
    "          ": "",
    "         ": "",
    "        ": "",
    "       ": "",
    "      ": "",
    "     ": "",
    "    ": "",
    "   ": "",
    "  ": "",
    " ": "",
    "\n": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
    "": "",
}

//需排除的，正则匹配
var cnExcludeWhole = [
    /^x?\d+(\.\d+)?[A-Za-z%]{0,2}(\s.C)?\s*$/, //12.34K,23.4 °C
    /^x?\d+(\.\d+)?(e[+\-]?\d+)?\s*$/, //12.34e+4
    /^([\d\.]+) OP$/, //纯空格
    /^([\d\.]+)e(\d+) OP$/, //纯空格
    /^([\d\.]+)e(\d+) ℵ$/, //纯空格
    /^\s*$/, //纯空格
    /^\d+(\.\d+)?[A-Za-z]{0,2}.?\(?([+\-]?(\d+(\.\d+)?[A-Za-z]{0,2})?)?$/, //12.34M (+34.34K
    /^(\d+(\.\d+)?[A-Za-z]{0,2}\/s)?.?\(?([+\-]?\d+(\.\d+)?[A-Za-z]{0,2})?\/s\stot$/, //2.74M/s (112.4K/s tot
    /^\d+(\.\d+)?(e[+\-]?\d+)?.?\(?([+\-]?(\d+(\.\d+)?(e[+\-]?\d+)?)?)?$/, //2.177e+6 (+4.01+4
    /^(\d+(\.\d+)?(e[+\-]?\d+)?\/s)?.?\(?([+\-]?(\d+(\.\d+)?(e[+\-]?\d+)?)?)?\/s\stot$/, //2.177e+6/s (+4.01+4/s tot
];
var cnExcludePostfix = [
    /:?\s*x?\d+(\.\d+)?(e[+\-]?\d+)?\s*$/, //12.34e+4
    /:?\s*x?\d+(\.\d+)?[A-Za-z]{0,2}$/, //: 12.34K, x1.5
]

//正则替换，带数字的固定格式句子
//纯数字：(\d+)
//逗号：([\d\.,]+)
//小数点：([\d\.]+)
//原样输出的字段：(.+)
var cnRegReplace = new Map([
    [/^requires ([\d\.]+) more research points$/, '需要$1个研究点'],
    [/^Start with (.+) Incrementer$/, '开始时有 $1 个增量器'],
    [/^(\d+) Functions$/, '$1 函数'],
    [/^You're currently in Challenge (\d+).$/, '您目前正在挑战 $1。'],
    [/^Need (\d+) Boosters$/, '需要 $1 助推器'],
    [/^Need: (\d+) Decrementy$/, '需要: $1 减量'],
    [/^Need: (\d+)x mult$/, '需要: $1 倍'],
    [/^Need: (\d+) Challenge Completions$/, '需要: $1 挑战完成'],
    [/^(\d+) Boosts$/, '$1 提升'],
    [/^([\d\.]+)e(\d+) Boosters$/, '$1e$2 助推器'],
    [/^(\d+) Boosters$/, '$1 助推器'],
    [/^([\d\.]+) seconds$/, '$1 秒'],
    [/^Goal: (.+) OP$/, '目标: $1 OP'],
    [/^You have (.+) boosters$/, '你有 $1 助推器'],
    [/^You have (.+) Ordinal Points$/, '你有 $1 序数点'],
    [/^(.+)s in collapse$/, '收缩还有 $1 秒'],
    [/^Reward: Factor (.+) boosts Tier (.+) and$/, '奖励：因子 $1 提升了 $2 级和'],
    [/^Reward: autobuyer (.+) Incrementer (.+)~$/, '奖励：自动购买者 $1 Incrementer $2~'],
    [/^Auto Incementer (.+),$/, '自动加油机 $1,'],
    [/^Cost: (\d+) RP$/, '成本：$1 皇家点数'],
    [/^Usages: (\d+)\/$/, '用途：$1\/'],
    [/^workers: (\d+)\/$/, '工人：$1\/'],

]);